Task #M008F
Guess the number!
Guess the number!
This is an interactive challenge!
The program of the jury members will choose the number N (1 ≤ N ≤ 109). Your task is to find this number in no more than 100 queries. In each, you print one number Х (-231 ≤ X < 231), and the program outputs in response:
sign ‘>’ if X> N, or
sign '<' if X < N or
sign '=' if X = N
After each request, the program displays one of these characters on a new line: ‘>’, ‘<’, ‘=’.
Find the hidden number in no more than 100 queries. The last number printed is considered your answer.
NOTE: In interactive tasks, so that your solution does not receive the “Presentation Error” verdict, do not forget to throw the buffer:
- In Pascal language: flush (output)
- In C and C ++ languages: fflush (stdout) or cout.flush ()
- In Java: System.out.flush ()
- In Python: sys.stdout.flush ()
- In C #: Console.Out.Flush ()
| # | input.txt | output.txt |
|---|---|---|
| 1 |
> < > = |
6 3 5 4 |